package com.reading.framework.web.page;


import com.reading.framework.constant.Constants;
import com.reading.utils.ServletUtil;

/**
 * 表格数据处理
 *
 * @author ruoyi
 */
public class TableSupport {

    /**
     * 封装分页对象
     */
    public static PageDomain getPageDomain() {
        PageDomain pageDomain = new PageDomain();
        pageDomain.setPageNum(ServletUtil.getParameterToInt(Constants.PAGENUM));
        pageDomain.setPageSize(ServletUtil.getParameterToInt(Constants.PAGESIZE));
        pageDomain.setOrderByColumn(ServletUtil.getParameter(Constants.ORDERBYCOLUMN));
        pageDomain.setIsAsc(ServletUtil.getParameter(Constants.ISASC));
        return pageDomain;
    }

    public static PageDomain buildPageRequest() {
        return getPageDomain();
    }

}
